﻿[output_none]


	[var:'CMS_site_path'='/SHoebox/']
	[var:'CMS_site_path_url'='http://' + (Server_Name) + $CMS_site_path]
	[var:'CMS_template'='default']
	[var:'CMS_defaultlanguage'='EN']
	[var:'CMS_linkbaseurl'=(response_filepath)]

	[library: $CMS_site_path + 'cms_frontend.lasso']
	
	
	<!-- Create a new CMS object -->
		[var:'myCMS'=shp_CMS()]
	
	
	<!-- Get the language -->
		[var:'mylang'=(Encode_SQL:(Action_Param:'l'))]
		[if:($mylang)=='']
			[var:'mylang'=$CMS_defaultlanguage]
		[/if]
		[$myCMS->getLang(-l=$mylang)]

	
	<!-- Get the page -->
		[var:'mypage'=(Encode_SQL:(Action_Param:'p'))]
		[if:($mypage)=='']
			[$myCMS->getPage('1')]
		[/if]
		[$myCMS->getPage($mypage)]
	
	
	<!-- Get the output format -->
		[var:'myFormat'=(Encode_SQL:(Action_Param:'f'))]
		[Select: ($myFormat)]
			[Case('html')]
				[var:'myTemplate'=$CMS_site_path + 'templates/' + $CMS_template + '/index.lasso']
			[Case('rss')]
				[var:'myTemplate'=$CMS_site_path + 'templates/' + $CMS_template + '/rss.lasso']
			[Case]
				[var:'myTemplate'=$CMS_site_path + 'templates/' + $CMS_template + '/index.lasso']
		[/Select]
	


	<!-- Get the menus -->
	
		[var:'sql_home_menu'='
			SELECT		*
			FROM 		SHb_menus
			INNER JOIN	SHb_translations_menus ON SHb_translations_menus._k2_menuid = SHb_menus._k1_menuid
			INNER JOIN	SHb_languages ON SHb_languages._k1_languageid = SHb_translations_menus._k2_languageid
			WHERE 		SHb_languages.language = \'' + $mylang + '\'
			AND			SHb_menus.active = 1
			AND			SHb_menus._k2_pagetypeid = 0']
		[Inline: -InlineName='Get_home_menu', -database='SHoebox', -sql=$sql_home_menu][/Inline] 
	
	
	
		[var:'sql_top_menus'='
			SELECT		*
			FROM 		SHb_menus
			INNER JOIN	SHb_translations_menus ON SHb_translations_menus._k2_menuid = SHb_menus._k1_menuid
			INNER JOIN	SHb_languages ON SHb_languages._k1_languageid = SHb_translations_menus._k2_languageid
			WHERE 		SHb_languages.language = \'' + $mylang + '\'
			AND			SHb_menus.active = 1
			AND			SHb_menus._k2_parentid = 1
			AND	NOT		SHb_menus._k2_pagetypeid = 0
			ORDER BY	SHb_menus._k2_parentid, SHb_menus._k1_menuid']
		[Inline: -InlineName='Get_top_menus', -database='SHoebox', -sql=$sql_top_menus][/Inline] 
	



[/output_none]
[Include: $myTemplate]